package com.example.mapper;

import com.example.entity.User;
import com.example.page.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:tjf
 * @Description:
 */
public interface UserMapper {
    /**
     * 根据用户名，查找用户
     * @param userCode
     * @return
     */
    User findUserByCode(String userCode);

    /**
     * 根据条件统计用户数量
     * @param user
     * @return
     */
    int selectCountUserByCondition(User user);

    /**
     * 根据条件对user_info表进行分页查询
     * @param page
     * @param user
     * @return
     */
    List<User> selectUserForPagination(@Param("page") Page page, @Param("user") User user);

    /**
     * 用户新增
     * @param user
     * @return
     */
    int insertUser(User user);

    int updateUserStateByUserId(User user);

    int deleteUserById(int userId);
    int deleteUserByList(List<Integer> list);
    int updateUserNameByUserId(User user);
    int updatePasswdByUserId(User user);
}
